<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <title>借用方法模式</title>
</head>
<body>
<script type="text/javascript">
    /*
    * 本方法是通过call()、aplly()两个方法来实现的
    * */
    // eg:
    function fun() {
        var args = Array.prototype.slice.call(arguments, 1, 3);
        return args;
    }
    var aa = fun(1, 2);
    console.log(aa);

    // 题外
    var one = {
        name: "haha",
        sayName: function() {
            alert(this.name);
        }
    };
    window.name = "nima";
    one.sayName();
    (function() {
        return one.sayName;
    }())();

</script>
</body>
</html>